package com.stock.config;

import com.google.common.util.concurrent.RateLimiter;
import com.stock.properties.LimiterProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RateLimiterConfiguration {

    @Bean
    public RateLimiter rateLimiter(LimiterProperties limiterProperties) {
        return RateLimiter.create(limiterProperties.getConcurrentNum());
    }

}
